<div data-ng-include="'/themes/adminLTE/unl_data/pages/constant/header.html'" data-ng-controller="HeaderController" style="height: 50px;">
</div>
<div class="wrapper" style="height:80%;">
<!-- AdminLTE App -->

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
      <!-- Content Header (Page header) -->
      <!--<section class="content-header" >
        <h1>
          File manager
          <small>here you can manage you labs</small>
        </h1>
      </section>-->
    <!-- Main content -->
	<section class="content row" style="padding-top: 0;">
    <div class="box-header with-border">
		<h3 class="box-title" style="padding-right:10px;"><b><i class="fa fa-sitemap" aria-hidden="true"></i> 文件管理</b> 
		</h3>
		<ol class="breadcrumb" style="margin-bottom:0px; display: inline-block; padding-left:10px; padding-right:10px;">
			<li>当前位置</li>
			<li data-ng-repeat="foldername in splitPath track by $index">
				<a class="pointer" data-ng-click="fileMngDraw(splitPathArray[$index])">{{foldername}}</a></li>
		</ol>
    </div>
      <div class="col-xs-12">
          <div class="box box-default">
            <!-- <div class="box-header with-border">
				<h3 class="box-title" style="padding-right:10px;"><b><i class="fa fa-sitemap" aria-hidden="true"></i> File manager</b> 
				</h3>
				<ol class="breadcrumb" style="margin-bottom:0px; display: inline-block; padding-left:10px; padding-right:10px;">
					<li>Current position</li>
					<li data-ng-repeat="foldername in splitPath track by $index"><a class="pointer" data-ng-click="fileMngDraw(splitPathArray[$index])">{{foldername}}</a></li>
				</ol>
            </div> -->
			<!--<div class="box-header with-border">
              <h3 class="box-title">Current position: {{path}}</h3>
            </div> -->
            <div class="box-body no-padding" style="display: block; height:auto ">
			<table class="table table-hover table-light" data-ng-show="uploader.queue.length > 0">
			<thead>
				<tr class="uppercase">
					<th width="50%">名称</th>
					<th ng-show="uploader.isHTML5">大小</th>
					<th ng-show="uploader.isHTML5">进度</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="item in uploader.queue">
					<td><strong>{{ item.file.name }}</strong></td>
					<td ng-show="uploader.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td>
					<td ng-show="uploader.isHTML5">
						<div class="progress progress-sm" style="margin-bottom: 0;">
							<div class="progress-bar progress-bar-primary progress-bar-striped" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
						</div>
					</td>
					<td>
						<span ng-show="item.isSuccess" class="text-success">
							成功
							<!--<i class="glyphicon glyphicon-ok"></i>-->
						</span>
						<span ng-show="item.isCancel" class="text-info">
							取消
							<!--<i class="glyphicon glyphicon-ban-circle"></i>-->
						</span>
						<span ng-show="item.isError" class="text-danger">
							错误
							<!--<i class="glyphicon glyphicon-remove"></i>-->
						</span>

					</td>
					<td nowrap>
						<button type="button" class="btn btn-success btn-flat btn-xs pull-left" ng-click="item.upload()" ng-disabled="item.isReady || item.isUploading || item.isSuccess"><span class="glyphicon glyphicon-upload"></span> 上传
						</button>
						<a href="javascript:;" type="button" data-toggle="tooltip" title="从上传列表中移除" class="text-danger pull-right" ng-click="item.remove()">
							<i class="fa fa-times"></i>
							<!--<span class="glyphicon glyphicon-trash"></span> Remove-->
						</a>
					</td>
				</tr>
				<tr data-ng-show="uploader.queue.length > 1">
					<td nowrap>
						<button type="button" class="btn btn-success btn-flat btn-xs" ng-click="uploader.uploadAll()" ng-disabled="!uploader.getNotUploadedItems().length">
						<span class="glyphicon glyphicon-upload"></span> 全部上传
						</button>
						<button type="button" class="btn btn-danger btn-flat btn-xs" ng-click="uploader.clearQueue()" ng-disabled="!uploader.queue.length">
						<span class="glyphicon glyphicon-trash"></span> 全部删除
						</button>
					</td>
				</tr>
			</tbody>
			</table>
			<div class="col-md-12" data-ng-show="uploader.queue.length > 1">
				<p>整体进度:</p>
				<div class="progress progress-sm" style="">
					<div class="progress-bar progress-bar-success" role="progressbar" ng-style="{ 'width': uploader.progress + '%' }"></div>
				</div>
			</div>
			<div class="row">	
			<div class="col-md-4">	
			 <div class="mailbox-controls" style="{{ (role == 'admin') ? '' : 'display:none'}}">
		<div class="mailbox-controls" ><!--  data-ng-show="newElementToggle" -->
                                <div class="form-group">
                                        <div class="input-group input-group-sm">
                                                <input type="text" class="form-control" placeholder="新文件夹名称"  data-ng-model="newElementName" my-enter="createNewElement(thatCreate)" focus-on="foCreate" style="border-radius:0px" ng-focus="newElementName=''; elementToggleFun('Folder');">
                                                        <span class="input-group-btn">
                                                        <button type="button" class="btn btn-success btn-flat {{blockButtonsClass}}" style="border-radius:0px" ng-disabled="blockButtons" data-ng-click="createNewElement(thatCreate)">新建文件夹</button>
                                                        </span>
                                        </div>
                                </div>
                          </div>
                <!-- Check all button -->
                <a type="button" class="btn btn-default btn-sm checkbox-toggle" data-toggle="tooltip" title="全选" data-ng-click="selectAll()" data-ng-show="!allCheckedFlag"><i class="fa fa-square-o"></i>
                </a>
				<a type="button" class="btn btn-default btn-sm checkbox-toggle" data-toggle="tooltip" title="反选" data-ng-click="selectAll()" data-ng-show="allCheckedFlag"><i class="fa fa-check-square-o"></i>
                </a>
                <div class="btn-group btn-options-main">
                  <!-- <a type="button" class="btn btn-default btn-sm" data-toggle="tooltip" title="Add new folder" data-ng-click="newElementName=''; elementToggleFun('Folder');"><i class="fa fa-folder"></i></a> -->
                  <a type="button" class="btn btn-default btn-sm" data-toggle="tooltip" title="新建 Lab" data-ng-click="openModal('addfile', null,'megalg');"><i class="fa fa-file"></i></a>
                  <a type="button" class="btn btn-default btn-sm" data-toggle="tooltip" title="重命名 Lab" data-ng-click="editElementShow();" ><i class="fa fa-pencil"></i></a>
                  <a type="button" class="btn btn-default btn-sm" data-toggle="tooltip" title="移动到..." data-ng-click="moveto()" ><i class="fa fa-scissors"></i></a>
                  <a type="button" class="btn btn-default btn-sm" data-toggle="tooltip" title="删除选择" data-ng-click="deleteALLElement(); hideAllEdit()"><i class="fa fa-trash-o"></i></a>
                </div>
				<div class="btn-group btn-options-main">
					<a type="button" class="btn btn-default btn-sm hidden-xs" data-toggle="tooltip" title="导入 Lab" data-ng-click="selectOneFileUplad(); falseForSelAll();"><i class="fa fa-download"></i></a>
					<a type="button" class="btn btn-default btn-sm hidden-xs" data-toggle="tooltip" title="导出 Lab" data-ng-click="exportFiles()"><i class="fa fa-upload"></i></a>
                </div>
                <!-- /.btn-group -->
		<a type="button" class="btn btn-default btn-sm" data-toggle="tooltip" title="排序" data-ng-click="toggleOrder(); fileMngDraw(path); falseForSelAll();"><i class="fa fa-caret-square-o-down"></i></a>
                <a type="button" class="btn btn-default btn-sm" data-toggle="tooltip" title="刷新" data-ng-click="fileMngDraw(path); falseForSelAll();"><i class="fa fa-refresh"></i></a> 
                <!-- /.pull-right -->
              </div>
			  <div class="table-responsive mailbox-messages"  style="height: 70vh ; overflow: auto;">
                <table style="table-layout: fixed; width: 100%;" class="table table-hover table-striped tablefont customHover" id="filesTree">
                  <tbody>
				  <!-- make item array - fileManagerItem['Fo_'+x.name] = [ x.name, x.name, visibleEdit, type] -->
                  <tr data-ng-repeat="x in rootDir.folders">
                    <td width="5%"><div class="treecb"><input type="checkbox" data-ng-show="x.name != '..'" data-ng-init="checkboxArray['Fo_'+x.name]['name']=x.name; checkboxArray['Fo_'+x.name]['checked']=false; checkboxArray['Fo_'+x.name]['type']='Folder';" data-ng-model="checkboxArray['Fo_'+x.name]['checked']" data-ng-click="falseForSelAll(); hideAllEdit();" class="folder_check"/></div></td>
                    <td style="word-wrap: break-word;" class="mailbox-star" data-ng-click="selectElbyTD(checkboxArray['Fo_'+x.name])" data-ng-mousemove="visibleArray[x.name]=true" data-ng-mouseleave="visibleArray[x.name]=false">
						<a class="pointer" data-ng-click="fileMngDraw(x.path, x.name); $event.stopPropagation();" data-ng-init="fileManagerItem['Fo_'+x.name]['visibleEdit']=false; fileManagerItem['Fo_'+x.name]['type']='Folder';" data-ng-show="!fileManagerItem['Fo_'+x.name]['visibleEdit']">
							<i class="fa fa-folder" style="color:#dfba49"></i>
							{{x.name}} 
							<div class="spinner" style="display: inline-block;" data-ng-init="fileManagerItem['Fo_'+x.name]['img']=false" data-ng-show="fileManagerItem['Fo_'+x.name]['img']">
								<div class="rect1"></div>
								<div class="rect2"></div>
								<div class="rect3"></div>
								<div class="rect4"></div>
								<div class="rect5"></div>
							</div>
							<!-- <img src="/themes/adminLTE/dist/img/waiting.gif" style="width:15px;height:15px" data-ng-init="fileManagerItem['Fo_'+x.name]['img']=false" data-ng-show="fileManagerItem['Fo_'+x.name]['img']"> -->
						</a>
						<div class="form-group" data-ng-show="fileManagerItem['Fo_'+x.name]['visibleEdit']">
							<div class="input-group input-group-sm">
								<span class="input-group-addon"><i class="fa fa-folder" style="color:#dfba49"></i></span>
								<input type="hidden" data-ng-init="fileManagerItem['Fo_'+x.name]['oldvalue']=x.name" data-ng-model="fileManagerItem['Fo_'+x.name]['oldvalue']"/>
								<input type="text" class="form-control" style="border-radius:0px" focus-on="Fo_{{x.name}}" data-ng-init="fileManagerItem['Fo_'+x.name]['value']=x.name" data-ng-model="fileManagerItem['Fo_'+x.name]['value']" data-ng-click="$event.stopPropagation();" my-enter="editElementApply(fileManagerItem['Fo_'+x.name]); $event.stopPropagation();">
								<span class="input-group-btn">
									<button type="button" class="btn btn-success btn-flat {{blockButtonsClass}}" ng-disabled="blockButtons" style="border-radius:0px" data-ng-click="editElementApply(fileManagerItem['Fo_'+x.name]); $event.stopPropagation();">确定</button>
								</span>
							</div>
						</div>
						<div class="pull-right button-box" style="{{ (role == 'admin') ? '' : 'display:none'}}">
						<button type="button" class="btn btn-default btn-flat btn-xs" data-ng-show="visibleArray[x.name] && x.name != '..' && !fileManagerItem['Fo_'+x.name]['visibleEdit']" data-ng-click="moveto()"><i class="fa fa-scissors"></i> 移动到</button>
						<button type="button" class="btn btn-default btn-flat btn-xs" data-ng-show="visibleArray[x.name] && x.name != '..' && !fileManagerItem['Fo_'+x.name]['visibleEdit']" data-ng-click="openRename(fileManagerItem['Fo_'+x.name], $event)"><i class="fa fa-edit"></i> 重命名</button>
						<button type="button" class="btn btn-danger btn-flat btn-xs" data-ng-show="visibleArray[x.name] && x.name != '..' && !fileManagerItem['Fo_'+x.name]['visibleEdit']" data-ng-click="deleteElement(x.path,'Folder','true')"><i class="fa fa-trash-o"></i></button>
						</div>
					</td>
                  </tr>
				   <tr data-ng-repeat="x in rootDir.labs | orderBy : fileOrder">
                    <td width="5%"><div class="treecb"><input type="checkbox" data-ng-click="falseForSelAll(); hideAllEdit();" data-ng-init="checkboxArray['Fi_'+x.file]['name']=x.file; checkboxArray['Fi_'+x.file]['checked']=false; checkboxArray['Fi_'+x.file]['type']='File';" data-ng-model="checkboxArray['Fi_'+x.file]['checked']"></div></td>
                    <td style="word-wrap: break-word" class="mailbox-star" data-ng-click="selectElbyTD(checkboxArray['Fi_'+x.file])" data-ng-mousemove="visibleArray[x.file]=true" data-ng-mouseleave="visibleArray[x.file]=false">
						<a class="pointer" style="{{ (x.path == fullPathToFile) ? 'color:green' : ''}}" data-ng-click="getLabInfo(x.path, x.file,x.show); $event.stopPropagation();" data-ng-init="fileManagerItem['Fi_'+x.file]['visibleEdit']=false; fileManagerItem['Fi_'+x.file]['type']='File';" data-ng-show="!fileManagerItem['Fi_'+x.file]['visibleEdit']">
							<i class="fa fa-file"></i> 
							{{x.yf_name}}
							<div class="spinner" style="display: inline-block;" data-ng-init="fileManagerItem['Fi_'+x.file]['img']=false" data-ng-show="fileManagerItem['Fi_'+x.file]['img']">
								<div class="rect1"></div>
								<div class="rect2"></div>
								<div class="rect3"></div>
								<div class="rect4"></div>
								<div class="rect5"></div>
							</div>
							<!-- <img src="/themes/adminLTE/dist/img/waiting.gif" style="width:15px;height:15px;" data-ng-init="fileManagerItem['Fi_'+x.file]['img']=false" data-ng-show="fileManagerItem['Fi_'+x.file]['img']"> -->
						</a>

						<div class="form-group" data-ng-show="fileManagerItem['Fi_'+x.file]['visibleEdit']">
							<div class="input-group input-group-sm">
								<span class="input-group-addon"><i class="fa fa-file"></i></span>
								<input type="hidden" data-ng-init="fileManagerItem['Fi_'+x.file]['oldvalue']=x.file" data-ng-model="fileManagerItem['Fi_'+x.file]['oldvalue']">
								<input type="text" class="form-control"style="border-radius:0px" focus-on="Fi_{{x.file}}" data-ng-init="fileManagerItem['Fi_'+x.file]['value']=x.file" data-ng-model="fileManagerItem['Fi_'+x.file]['value']" data-ng-click="$event.stopPropagation();" my-enter="editElementApply(fileManagerItem['Fi_'+x.file]); $event.stopPropagation();">
								<span class="input-group-btn">
									<button type="button" class="btn btn-success btn-flat {{blockButtonsClass}}" ng-disabled="blockButtons" style="border-radius:0px" data-ng-click="editElementApply(fileManagerItem['Fi_'+x.file]); $event.stopPropagation();">确定</button>
								</span>
							</div>
						</div>

						<div class="pull-right button-box" style="{{ (role == 'admin' || role == 'teacher' || role == 'referee' || role == 'student' || role == 'player') ? '' : 'display:none'}}">
						<button type="button" class="btn btn-default btn-flat btn-xs" data-ng-show="visibleArray[x.file] &&  !fileManagerItem['Fi_'+x.file]['visibleEdit'] && in_array(x.show,[1,2,4,6,9,11])" data-ng-click="uncheck_all();checkboxArray['Fi_'+x.file]['checked'] = true; moveto()"><i class="fa fa-scissors"></i>移动到</button>
						<button type="button" class="btn btn-default btn-flat btn-xs" data-ng-show="visibleArray[x.file] && !fileManagerItem['Fi_'+x.file]['visibleEdit']  && in_array(x.show,[1,2,4,6,9,11,13,14])" data-ng-click="openRename(fileManagerItem['Fi_'+x.file], $event)"><i class="fa fa-edit"></i>重命名</button>
						<button type="button" class="btn btn-default btn-flat btn-xs" data-ng-show="visibleArray[x.file] && !fileManagerItem['Fi_'+x.file]['visibleEdit']  && in_array(x.show,[1,2,4,6,9,11,13,14])" data-ng-click="cloneElement(fileManagerItem['Fi_'+x.file], $event)"><i class="fa fa-clone"></i>本地复制</button>
						<button type="button" class="btn btn-default btn-flat btn-xs" data-ng-show="visibleArray[x.file] && !fileManagerItem['Fi_'+x.file]['visibleEdit']  && in_array(x.show,[2,3,4,5,6,7,8,9,10,11])" data-ng-click="cloneElementtome(fileManagerItem['Fi_'+x.file], $event)"><i class="fa fa-clone"></i>复制到我的目录</button>
						<button type="button" class="btn btn-danger btn-flat btn-xs" data-ng-show="visibleArray[x.file] && !fileManagerItem['Fi_'+x.file]['visibleEdit'] && in_array(x.show,[1,2,4,6,9,11,13,14])" data-ng-click="deleteElement(x.path,'File','true')"><i class="fa fa-trash-o"></i></button>
						</div>
						<div class="mtime pull-right"style=";text-align: right;" data-ng-show="(!visibleArray[x.file] || (visibleArray[x.file] && !in_array(x.show,[1,2,3,4,5,6,7,8,9,10,11,11,13,14]))) && !fileManagerItem['Fi_'+x.file]['visibleEdit'] ">{{x.mtime}}</div>
					</td>
                  </tr>
                  </tbody>
                </table>
                <!-- /.table -->
              </div>
              </div>
			  <!--FILE MANAGER END-->
			  <!--LAB INFO START-->
			  <div class="col-md-8">
			  <div class="form-group center-block" data-ng-show="!fileSelected" style="height:362px;">
								<h4 class="text-center" style="padding-top: 90px;">选择 LAB 查看更多信息</h4>
								<!--<input type="email" class="form-control" id="email">-->
				</div>
					<div data-ng-include="'/themes/adminLTE/unl_data/pages/constant/labView.html'" data-ng-show="fileSelected">
				</div>
            </div>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /. box -->
        <!-- /.col -->
        
          
            <!-- /.box-body -->
          </div>
          <!-- /. box -->
        </div>
        <!-- /.col -->
	
   <!-- /.content -->
    </section>
  </div>
  <!-- /.content-wrapper -->
  
  <input type="file" nv-file-select uploader="uploader" id="oneFileUploadInput" data-ng-model="fileupload" onchange="angular.element(this).scope().fileNameChanged()" style="display:none" multiple />
  <!-- Main Footer -->
  <div data-ng-include="'/themes/adminLTE/unl_data/pages/constant/footer.html'" data-ng-controller="FooterController">
</div>
<!-- ./wrapper -->
<script>
</script>
<script src="/themes/adminLTE/dist/js/app.js"></script>
<link rel="stylesheet" href="/themes/adminLTE/unl_data/css/unl_lab.css">
<!-- <link rel="stylesheet" href="/themes/adminLTE/unl_data/css/custom_unl_lab.css"> -->
<link rel="stylesheet" href="/themes/adminLTE/dist/css/skins/skin-blue.css">
